<% remote_form_for :relationship, :url => {:controller => 'relationships', :action => 'create', :person_id => @person} do |f| %>

<div id='select_relationship_type'>
	<b>Select Relationship Type: </b><%= collection_select(:relationship,
														   :relationship_type_id,
														    RelationshipType.find(:all, :order => :name),
														    :id, :name, :prompt => "--select relationship type--") %>
</div>
<hr>

<%= observe_field 'relationship_relationship_type_id',
 	:url => {:action => 'relationship_type_changed', :id => @person},
	:with => 'relationship_type_id' %>

<div style="width:48%;float:left;">
	&nbsp;
	<div id="person_role">
		<%= render :partial => "person_role", :locals => {:person => @person} %>
	</div>
</div>

<div style="width:48%;float:left;">
	&nbsp;
	<div id="relates_to_chooser">
		<%= render :partial => "chooser_link" %>
	</div>
	<div id="relates_to_person_id">
			<%= render :partial => "relates_to_person_id" %>
	</div>
	<div id="relates_to_person">
		<%= render :partial => "relates_to_person" %>
	</div>
	<div id="relates_to_role">
		<%= render :partial => "relates_to_role", :locals => {:relates_to_person => @relates_to_person} %>
	</div>
</div>

<div style="float:none;clear:both;">
	&nbsp;
</div>

<div>
	<b style="vertical-align:top;">Comments: </b><%= text_area :relationship, :comments, :cols => 60, :rows => 4 %>
</div>

<table width=100%>
	<tr>
		<td>Start Date:</td>
		<td>End Date:</td>
		<td>Inactive:</td>
		<td>Web Access:</td>
	</tr>
	<tr>
		<td>
			<%= date_field :relationship, :start_date %>
		</td>
		<td>
			<%= date_field :relationship, :end_date %>
		</td>
		<td>
			<%= check_box :relationship, :inactive %>
		</td>
		<td>
			<%= check_box :relationship, :web_access %>
		</td>
	</tr>
</table>
	
	<div>
		
	</div>
	
	
	<%= submit_tag 'Create' %>
	
<% end %>